package array

import (
	"encoding/json"
	"reflect"
)

/**
|---------------------------------
| 数组切片，map操作
| user: fcl date: 2022/7/6
|---------------------------------
|
*/

type Array struct {
}

func (a *Array) MapToStructByTags(m interface{}, s interface{}) {
	mr := reflect.ValueOf(m)
	if mr.Kind().String() != "map" {
		mStr, _ := json.Marshal(m)
		panic("param is not type `map`" + string(mStr))
	}
	sr := reflect.ValueOf(&s)
	if sr.Kind().String() != "struct" {
		sStr, _ := json.Marshal(s)
		panic("param is not type `struct` " + string(sStr))
	}

}
